﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin1/SiteAdmin.master" AutoEventWireup="true" CodeFile="Guide.aspx.cs" Inherits="admin1_Guide" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<%@ Register Assembly="CKFinder" Namespace="CKFinder" TagPrefix="CKFinder" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style>
        .control-group {
            border-top: 1px solid #ffffff;
            border-bottom: 1px solid #eeeeee;
            margin-bottom: 0;
        }

        .control-label {
            padding-top: 15px;
            width: 180px;
            float: left;
            text-align: right;
        }

        .controls {
            margin-left: 200px;
            padding: 10px 0;
        }
    </style>
    <script src="../ckeditor/ckeditor.js"></script>
    <script src="../ckfinder/ckfinder.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="Server">
    <%-- Thêm tour --%>
    <asp:Panel ID="panel_Add" Width="100%" runat="server" Visible="False">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-info-sign"></i>
                    </span>
                    <span class="icon1">
                        <asp:LinkButton ID="lbt_ClosAdd" runat="server" OnClick="lbt_ClosAdd_Click"><img src="img/icons/16/close.png" /></asp:LinkButton>
                    </span>
                    <h5>Thêm hướng dẫn viên</h5>
                </div>
                <div class="widget-content nopadding">
                    <div class="control-group">
                        <label class="control-label">Tên đầy đủ</label>
                        <div class="controls">
                            <div class="ctr">
                                <div class="rw">
                                    <asp:TextBox ID="txt_Name" runat="server" CssClass="null"></asp:TextBox>
                                </div>
                                <div class="rw_text">Ngày sinh</div>
                                <div class="rw">
                                    <asp:TextBox ID="txt_Birthday" runat="server" CssClass="null"></asp:TextBox>
                                </div>
                                <div class="rw_text">Số điện thoại</div>
                                <div class="rw">
                                    <asp:TextBox ID="txt_Phone" runat="server" CssClass="null"></asp:TextBox>
                                </div>
                            </div>
                            <div style="height: 10px;">
                                <div class="val">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Nhập tên đầy đủ" ControlToValidate="txt_Name" Display="Static" ValidationGroup="a" Style="color: red;"></asp:RequiredFieldValidator>
                                </div>
                                <div class="val">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Nhập ngày sinh" ControlToValidate="txt_Birthday" ValidationGroup="a" Style="color: red;"></asp:RequiredFieldValidator>
                                </div>
                                <div class="val">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Nhập số điện thoại" ControlToValidate="txt_Phone" ValidationGroup="a" Style="color: red;"></asp:RequiredFieldValidator>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Giới tính</label>
                        <div class="controls">
                            <asp:DropDownList ID="ddl_Sex" runat="server" Width="220">
                                <asp:ListItem Text="Nam" Value="Nan"></asp:ListItem>
                                <asp:ListItem Text="Nữ" Value="Nu"></asp:ListItem>
                                <asp:ListItem Text="Khác" Value="Khac"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Địa chỉ</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Address" CssClass="NameEdit" runat="server"  Width="800"></asp:TextBox>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Ảnh đại diện</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_ImageAdd" runat="server" Width="800">
                            </asp:TextBox><input id="Browser" value="Chọn ảnh" type="button" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Chưa chọn ảnh đại diện" ControlToValidate="txt_Image_Edit" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls">
                            <asp:Button ID="btnInsert" runat="server" Text="Save change" OnClick="btnInsert_Click" class="btn btn-success" ValidationGroup="a" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>
    <asp:Panel ID="panel_Edit" Width="100%" runat="server" Visible="False">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon">
                        <i class="icon-info-sign"></i>
                    </span>
                    <span class="icon1">
                        <asp:LinkButton ID="lbt_Clase_Edit" runat="server" OnClick="lbt_Clase_Edit_Click"><img src="img/icons/16/close.png" /></asp:LinkButton>
                    </span>
                    <h5>Chỉnh sửa thông tin của hướng dẫn viên</h5>
                </div>
                <div class="widget-content nopadding">
                    <div class="control-group">
                        <label class="control-label">Mã</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Guidid_Edit" CssClass="NameEdit" runat="server" Enabled="False"></asp:TextBox>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Tên đầy đủ</label>
                        <div class="controls">
                            <div class="ctr">
                                <div class="rw">
                                    <asp:TextBox ID="txt_Name_Edit" runat="server" CssClass="null"></asp:TextBox>
                                </div>
                                <div class="rw_text">Ngày sinh</div>
                                <div class="rw">
                                    <asp:TextBox ID="txt_Birthday_Edit" runat="server" CssClass="null"></asp:TextBox>
                                </div>
                                <div class="rw_text">Số điện thoại</div>
                                <div class="rw">
                                    <asp:TextBox ID="txt_Phone_Edit" runat="server" CssClass="null"></asp:TextBox>
                                </div>
                            </div>
                            <div style="height: 10px;">
                                <div class="val">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Nhập tên đầy đủ" ControlToValidate="txt_Name" Display="Static" ValidationGroup="a" Style="color: red;"></asp:RequiredFieldValidator>
                                </div>
                                <div class="val">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="Nhập ngày sinh" ControlToValidate="txt_Birthday" ValidationGroup="a" Style="color: red;"></asp:RequiredFieldValidator>
                                </div>
                                <div class="val">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Nhập số điện thoại" ControlToValidate="txt_Phone" ValidationGroup="a" Style="color: red;"></asp:RequiredFieldValidator>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Giới tính</label>
                        <div class="controls">
                            <asp:DropDownList ID="ddl_Sex_Edit" runat="server" Width="220">
                                <asp:ListItem Text="Nam" Value="Nan"></asp:ListItem>
                                <asp:ListItem Text="Nữ" Value="Nu"></asp:ListItem>
                                <asp:ListItem Text="Khác" Value="Khac"></asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Địa chỉ</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Address_Edit" CssClass="NameEdit" runat="server" Width="800"></asp:TextBox>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Ảnh đại diện</label>
                        <div class="controls">
                            <asp:TextBox ID="txt_Image_Edit" runat="server" Width="800">
                            </asp:TextBox><input id="Browser1" value="Chọn ảnh" type="button" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="Chưa chọn ảnh đại diện" ControlToValidate="txt_Image_Edit" ValidationGroup="a"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"></label>
                        <div class="controls">
                            <asp:Button ID="btn_Save_Edit" runat="server" Text="Save change" OnClick="btn_Save_Edit_Click" class="btn btn-success" ValidationGroup="a" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>
    <%-- box Category--%>
    <div class="row-fluid" style="margin-top: 10px;">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title">
                    <span class="icon"><i class="icon-th"></i></span>
                    <asp:LinkButton ID="lbt_Add_New" runat="server" OnClick="lbt_Add_New_Click"><img src="img/icons/16/add.png"  width="34" /></asp:LinkButton>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered data-table">
                        <thead>
                            <tr>
                                <th>Mã</th>
                                <th>Tên</th>
                                <th>Ngày sinh</th>
                                <th>Số điện thoại</th>
                                <th>Giới tính</th>
                                <th>Ảnh minh họa</th>
                                <th>Địa chỉ</th>
                                <th>Chức Năng</th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:Repeater ID="rpt_Category" runat="server">
                                <ItemTemplate>
                                    <tr class="gradeX">
                                        <td class="center"><%#Eval("GuideId") %></td>
                                        <td><%#Eval("Name") %></td>
                                        <td class="center"><%#Eval("Birthday") %> VND</td>
                                        <td class="center"><%#Eval("Phone")%></td>
                                        <td class="center"><%#Eval("Sex") %></td>
                                        <td class="center">
                                            <img class="img_prod" src="<%#Eval("Image") %>" /></td>
                                        <td class="center"><%#Eval("Address")%></td>
                                        <td class="center">
                                            <asp:LinkButton ID="lbtChinhSua" CommandArgument='<%#Eval("GuideId") %>' runat="server" ToolTip="Chỉnh Sửa" OnClick="lbtChinhSua_Click"><img src="img/icons/16/create.png" width="16" height="18"/></asp:LinkButton>
                                            &nbsp;&nbsp;<asp:LinkButton ID="btnxoa" CommandArgument='<%#Eval("GuideId") %>' runat="server" ToolTip="Xóa" OnClick="btnxoa_Click" OnClientClick="return confirm('Bạn có chắc chắn muốn xóa?');"><img src="img/icons/16/delete.png" width="16" height="18"/></asp:LinkButton>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#Browser").click(function () {
                var ckfinder = new CKFinder();
                ckfinder.selectActionFunction = function (fileUrl) {
                    $("#body_txt_ImageAdd").val(fileUrl);
                };
                ckfinder.popup();
            });
            $("#Browser1").click(function () {
                var ckfinder = new CKFinder();
                ckfinder.selectActionFunction = function (fileUrl) {
                    $("#body_txt_Image_Edit").val(fileUrl);
                };
                ckfinder.popup();
            });
        });
    </script>
</asp:Content>

